<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <cpn></cpn>
</div>
<!--method1-->
<template id="cpn">
    <div>
        <h2>我是模板标题</h2>
        <p>我是模板文字</p>
    </div>
</template>
<!--method2-->
<!--<script type="text/x-template" id="cpn">-->
<!--<div>-->
<!--    <h2>我是模板标题</h2>-->
<!--    <p>我是模板文字</p>-->
<!--</div>-->
<!--</script>-->
<script src="../js/vue.js"></script>
<script>
    const aaa = new Vue({
        el: "#app",
        data: {
            message: "hello,guys",
        },
        components: {
            cpn: {
                template: "#cpn",
            }
        }
    })
</script>
</body>
</html>